<?php

namespace common\models\member;

use Yii;

/**
 * This is the model class for table "{{%member_account}}".
 *
 * @property int $id
 * @property int $user_id 用户ID
 * @property int $member_id 会员ID
 * @property int $amount 历史累积（分）
 * @property int $current 当前账户（分）
 * @property int $withdraw 历史提现总额（分）
 * @property int $last_draw 上次提现金额（分）
 * @property string $secret 支付密码
 * @property int $status 账户状态：-1账户冻结，0未激活，10正常
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 * @property int $deleted_at 删除时间
 */
class MemberAccount extends \common\db\ActiveRecord {

    CONST STATUS_ACTIVE = 10;
    CONST STATUS_DEFAULT = 0;
    CONST STATUS_FREEZED = -1;
    CONST STATUS_FORBID = -1;

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%member_account}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['user_id', 'member_id', 'amount', 'current', 'withdraw', 'last_draw', 'status', 'created_at', 'updated_at', 'deleted_at'], 'integer'],
            [['secret'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'user_id' => '用户ID',
            'member_id' => '会员ID',
            'amount' => '历史累积（分）',
            'current' => '当前账户（分）',
            'withdraw' => '历史提现总额（分）',
            'last_draw' => '上次提现金额（分）',
            'secret' => '支付密码',
            'status' => '账户状态：-1账户冻结，0未激活，10正常',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
            'deleted_at' => '删除时间',
        ];
    }

}
